package com.example.train.common.util;

import cn.hutool.core.util.IdUtil;

//对hutool雪花算法的封装

public class SnowUtil {
    private static long dataCenterID=1;
    private static long workerId=1;

    public static long getSnowflakeNextId(){
        return IdUtil.getSnowflake(workerId,dataCenterID).nextId();
    }

    public static String getSnowflakeNextIdString(){
        return IdUtil.getSnowflake(workerId,dataCenterID).nextIdStr();
    }
}
